package com.java2007.zhangyu.restaurant.service;

import com.java2007.zhangyu.restaurant.entity.CartItem;
import com.java2007.zhangyu.restaurant.entity.Result;
import com.java2007.zhangyu.restaurant.pojo.Admin;
import com.java2007.zhangyu.restaurant.pojo.Order;

import java.sql.SQLException;
import java.util.List;

/**
 * @author zy
 * @Version
 * @date 2021/01/29
 */
public interface OrderService {

    /**
     * 创建订单
     * @param cart
     * @param cartTotalPrice
     * @param tId
     * @return
     */
    Result createOrder(List<CartItem> cart, Long cartTotalPrice, Integer tId);

    /**
     * 更新订单状态
     * @param oId 订单 id
     * @param status
     * @return
     * @throws SQLException
     */
    int updateOrderStatus(Long oId, int status) throws SQLException;

    /**
     * 查询所有订单
     * @return
     * @throws SQLException
     */
    List<Order> queryAllOrder() throws SQLException;
}
